package com.qf.mvc02.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/hello")
public class HelloController {

    @RequestMapping("/test1")
    public String test1(){

        int a = 1/0;

        return "/hello.jsp";
    }


    @ResponseBody
    @RequestMapping("/test2")
    public Map<String,String> test2(){

        final HashMap<String, String> map = new HashMap<>();

        map.put("name","luffy");
        map.put("age","20");

        return map;

    }

}
